package xpn.platform.modules.login;

import javax.servlet.http.HttpServletRequest;

import xpn.platform.common.exception.XpnAuthenticationException;

/**
 * 登录服务
 *
 * @author bobatkm
 *
 */
public interface LoginService {
	/**
	 * 根据传入的用户名、口令进行认证，返回认证结果
	 *
	 * @param userName
	 * @param password
	 * @param request
	 * @return
	 */
	Object login(String userName, String password, HttpServletRequest request)  throws XpnAuthenticationException;

	/**
	 * 根据传入的用户名、口令进行认证，返回认证结果
	 *
	 * @param userName
	 * @param password
	 * @param request
	 * @return
	 */
	Object authFrom4A(String userName, String password, HttpServletRequest request)  throws XpnAuthenticationException;


	/**
	 * 根据传入的token进行认证，返回认证结果
	 *
	 * @param token
	 * @param request
	 * @return
	 */
	Object login(String token, HttpServletRequest request)  throws XpnAuthenticationException;

	/**
	 * 注销当前用户
	 *
	 * @return: 成功消息
	 */
	void logout( );
}
